<nz-layout class="app-layout">
  <nz-header>
    <div class="app-header" nz-row nzType="flex" nzJustify="space-between">
      <div nz-col nzSpan="5" class="sidebar-logo">
        <a target="_blank">
          <img src="../../../assets/logo.ico" alt="logo" />
          <h1>医师服务管理系统</h1>
        </a>
      </div>
      <div nz-col nzSpan="1">
        <span class="header-trigger" (click)="isCollapsed = !isCollapsed">
          <i
            class="trigger"
            nz-icon
            [nzType]="isCollapsed ? 'menu-unfold' : 'menu-fold'"
          ></i>
        </span>
      </div>
      <div nz-col nzSpan="16" class="modular-list">
        <ul nz-menu nzTheme="dark" nzMode="horizontal" class="header-menu">
          <li
            nz-menu-item
            *ngFor="let menu of menuTable; index as key"
            (click)="change(key, menu.id)"
            [nzSelected]="key === +tabIndex"
          >
            {{ menu.name }}
          </li>
        </ul>
      </div>

      <div nz-col nzSpan="2" class="user-detail">
        <span class="header-trigger" (click)="isUp = !isUp">
          <i nz-icon nzType="user" nzTheme="outline"></i>
          <i nz-icon [nzType]="isUp ? 'caret-down' : 'caret-up'"></i>
        </span>

        <nz-layout *ngIf="isUp" class="topic-box">
          <p (click)="changePassWord()">修改密码</p>
          <p (click)="logout()">退出登录</p>
        </nz-layout>
      </div>
    </div>
  </nz-header>

  <nz-layout>
    <nz-sider
      class="menu-sidebar"
      nzCollapsible
      nzWidth="256px"
      nzBreakpoint="md"
      [(nzCollapsed)]="isCollapsed"
      [nzTrigger]="null"
    >
      <ul
        nz-menu
        nzTheme="dark"
        nzMode="inline"
        [nzInlineCollapsed]="isCollapsed"
        *ngFor="let menuRoute of routeSet"
      >
        <li
          nz-submenu
          [nzTitle]="menuRoute.name"
          [nzOpen]="menuRoute.name === menuRouteName"
        >
          <!-- [nzOpen]="menuRoute.name === '权限管理'" -->
          <ul *ngIf="menuRoute.children?.length">
            <li
              *ngFor="let route of menuRoute.children"
              nz-menu-item
              [nzSelected]="menuRouteUrl === route.url"
            >
              <ng-container
                *ngIf="
                  route.url && (route.url.indexOf('http') === -1 || environment.production);
                  else elseTemplate
                "
              >
                <a
                  (click)="updateBreadcrumb(route, menuRoute)"
                  >{{ route.name }}</a
                >
              </ng-container>
              <ng-template #elseTemplate>
                <a [href]="route.url" target="_blank">{{ route.name }}</a>
              </ng-template>
            </li>
          </ul>
        </li>
      </ul>
    </nz-sider>

    <nz-content>
      <nz-spin nzTip="加载中..." [nzSpinning]="spinning"  class="content-box">
        <div class="content-box">
          <div [hidden]="urlState === null || urlState === -1" id="iframe-box">

          </div>
          <div [hidden]="urlState !== -1" id="iframe-box1">

          </div>
          <div class="not-box" *ngIf="urlState === null">
            <h5>医师服务管理系统</h5>
          </div>
        </div>
    </nz-spin>
    </nz-content>
  </nz-layout>
</nz-layout>
<iframe style="opacity: 0;width: 0;height:0" src="./old/#!/home" frameborder="0"></iframe>
